package com.hsj.demo.dao;

import com.hsj.demo.entity.User;
import com.hsj.demo.entity.UserFriend;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserFriendDao extends CurdDao<UserFriend> {
    // 根据用户ID，查找最近好友
    public List<UserFriend> findBySourceId(@Param("id") Integer id,@Param("isRecently") Character isRecently);
    // 根据用户和好友ID，查找userFriendID
    public Integer findUserFriendId(@Param("sourceUserId") Integer sourceUserId,@Param("targetUserId") Integer targetUserId);
    // 根据分组ID查询
    public List<Integer> findByGroupId(Integer groupId);
    // 删除好友
    public Integer deleteFriend(UserFriend userFriend);

    public UserFriend findBySouAndTarId(UserFriend userFriend);

    List<UserFriend> findChatHistory(Integer sourceUserId);
}
